package com.ljc.cjgl.entitiy;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Transient;

import org.springframework.data.annotation.CreatedBy;

/***
 * 评分标准
 * @author ljc
 *
 */
@Entity
public class Scoring {
	private Integer id;
	private TbTest test;//考试
	private String title;//评分项
	private String explanation;//说明
	private Integer score; //分值
	
	public Scoring() {
		super();
	}
	@Id
	@GeneratedValue
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	
	@ManyToOne
	@CreatedBy
	public TbTest getTest() {
		return test;
	}
	public void setTest(TbTest test) {
		this.test = test;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public Integer getScore() {
		return score;
	}
	public void setScore(Integer score) {
		this.score = score;
	}
	public String getExplanation() {
		return explanation;
	}
	public void setExplanation(String explanation) {
		this.explanation = explanation;
	}
	public Scoring(Integer id, TbTest test, String title, String explanation, Integer score) {
		super();
		this.id = id;
		this.test = test;
		this.title = title;
		this.explanation = explanation;
		this.score = score;
	}
	
	@Transient
	public String getTestName() {
		return test==null?null:test.getName();
	}
	
	@Transient
	public Integer getTestId1() {
		return test==null?null:test.getId();
	}
}
